package com.qingyun.common.util;

import java.util.regex.Pattern;

public final class RegexUtils {
    private RegexUtils() {}

    private static final Pattern ACCOUNT = Pattern.compile("^[a-zA-Z0-9_]{3,32}$");
    private static final Pattern PASSWORD = Pattern.compile("^.{4,32}$");
    private static final Pattern CODE = Pattern.compile("^\\d{4,6}$");

    public static boolean isAccountInvalid(String s) {
        return s == null || !ACCOUNT.matcher(s).matches();
    }
    public static boolean isPasswordInvalid(String s) {
        return s == null || !PASSWORD.matcher(s).matches();
    }
    public static boolean isCodeInvalid(String s) {
        return s == null || !CODE.matcher(s).matches();
    }
}


